package com.tang.base;

import com.tang.util.GsonUtil;

import java.util.Map;

import okhttp3.MediaType;
import okhttp3.RequestBody;

/**
 * @author Snow
 * @date 2018/1/22
 * Description:
 */

public class PatchRequest implements Request {

    private final Map<String, Object> map;

    public PatchRequest(Map<String, Object>  map) {
        this.map = map;
    }

    public RequestBody getRequestBody() {
        String toJsonStr = GsonUtil.toJsonStr(map);
        RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), toJsonStr);
        return requestBody;
    }
}
